package com.duo.dto;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * @Author: Xrx
 * @Description:
 * @CreateTime: 2023/7/7 16:00
 */
@Data
public class DishUpdateDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 菜品id
     */
    @NotNull(message = "菜品id不能为空")
    private Long id;

    /**
     * 菜品名称
     */
    private String name;

    /**
     * 描述信息
     */
    @Length(max = 100, message = "描述信息不能超过100个字符")
    private String description;

    /**
     * 菜品分类名称
     */
    private Long categoryId;

    /**
     * 菜品价格
     */
    @DecimalMin(value = "0.01", message = "菜品价格不能小于0.01")
    private BigDecimal price;

    /**
     * 图片
     */
    private String image;

    /**
     * 0 停售 1 起售
     */
    @Digits(integer = 1, fraction = 0, message = "数值只能是0或1")
    private Integer status;

    /**
     * 口味
     */
    private List<DishFlavorDTO> flavors;


}
